package com.day02;

import lombok.*;

@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@ToString
public class JavaOrder implements Comparable<JavaOrder>{
    //user_id , order_id，goods_id，category_id，price，goods_num
    private String user_id;
    private String order_id;
    private String goods_id;
    private String category_id;
    private double price;
    private int goods_num;

    @Override
    public int compareTo(JavaOrder o) {
        return -Double.compare(o.getGoods_num()*o.getPrice(),this.goods_num*this.price);
    }
}
